import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import locale from "element-plus/es/locale/lang/zh-cn"; // 添加中文包
import { $get, $post, instance } from "@/api/http";
import usage from "@/utils/usage";
import "./assets/styles/reset.css";
import "./assets/styles/onlineTest.css";
import cookies from 'vue-cookies';
import moment from 'moment';

const app = createApp(App);

// 添加全局属性
app.config.globalProperties.$get = $get;
app.config.globalProperties.$post = $post;
app.config.globalProperties.$instance = instance;
app.config.globalProperties.$usage = usage;
app.config.globalProperties.$cookies=cookies;
app.config.globalProperties.$moment=moment;
app.use(ElementPlus, { locale }); // 引入element并设置中文包
app.use(store);
app.use(router);
app.mount('#app');


// 刷新页面缓存数据赋值到vuex
usage.cacheAssignmentVuex();
